<form class="tableform" method='post' action='index.php?app=b2c&ctl=admin_order&act=dosplit' id="order-split-form">
	<{if count($info) > 0}>
	<{foreach from=$info item=item}>
	<div class="division">
		<input type="hidden" name="order_id" value="<{$order_id}>">
		<table cellpadding="0" cellspacing="0">
			<tr>
				<th><{t}>供应商中文名:<{/t}><{$item.shop.chinese_all_name}></th>

				<th><{t}>供应商英文名:<{/t}><{$item.shop.english_all_name}></th>
			</tr>
		</table>
		<table cellpadding="0" cellspacing="0"  class="gridlist">
			<col style="width:20%"></col>
			<col style="width:25%"></col>
			<col style="width:15%"></col>
			<col style="width:10%"></col>
			<col style="width:10%"></col>
			<col style="width:20%"></col>
			<thead>
			<tr>
				<th><{t}>货号<{/t}></th>
				<th><{t}>商品名称<{/t}></th>
				<th><{t}>购买数量<{/t}></th>
				<th><{t}>已确认库存数量<{/t}></th>
				<th><{t}>此单确认<{/t}></th>
				<th><{t}>推荐商品<{/t}></th>
			</tr>
			</thead>
			<tbody>
			<{foreach from=$item.goods item=aProduct}>
			<tr>
				<td><{$aProduct.bn}></td>
				<td><{$aProduct.name}></td>
				<td><{$aProduct.quantity}></td>
				<td><{$aProduct.has_confirm_num}></td>
				<td>
					<{assign var="item_id" value=$aProduct.obj_id}>
					<{if $aProduct.state=='0'}>
					<!--<{t}>未确认<{/t}>-->
					<{input type="text" vtype="required&&number" name="confirm_num[{$item_id}]" value=$aProduct.quantity  q_data=$aProduct.quantity width="50" onblur="check(this)"}>
					<{else $aProduct.status=='1'}>
					<{t}>已确认<{/t}>
					<{/if}>
				</td>
				<td><{input type="object" object="goods@b2c" return_url=""  filter=$aProduct.glink_filter textcol="name" name="r_goods_id[{$aProduct.goods_id}]" value=$aProduct.glink.r_goods_id}></td>
			</tr>
			<{/foreach}>
			</tbody>
		</table>
	</div>
	<{/foreach}>
	<{/if}>
</form>
<{if $status != 1}>
<div class="table-action">
	<{button label=$___b2c="确定"|t:'b2c' id="order-split-form-submit" class="order-action" type="button"}>
</div>
<{/if}>
<script type="text/javascript">
(function(){
	var _form = $('order-split-form');
	var btn =$('order-split-form-submit');
	<{if $status != 1}>
	btn.addEvent('click',function(){
		_form.fireEvent('submit',{stop:$empty});
	});
	<{/if}>
})();

function check(obj){
	var gc_confirm_num = obj.get('value');
	var quantity = obj.get('q_data');
	if(isNaN(gc_confirm_num)){
		obj.set('value',quantity);
	}
	if(gc_confirm_num<0){
		obj.set('value',quantity);
	}
	if(gc_confirm_num>quantity){
		obj.set('value',quantity);
	}
}
</script>